<template>
  <div class="charts" ref="charts">

  </div>
</template>

<script>
import * as echarts from 'echarts';
export default {
  name: 'LineChart',
  mounted() {
    let lineCharts = echarts.init(this.$refs.charts)
    let options = {
      xAxis: {
        show: false,
        type: 'category'
      },
      yAxis: {
        show: false
      },
      series: [
        {
          data: [10, 77, 33, 88, 15, 47, 67, 12, 56, 10, 39],
          type: 'line',
          smooth: true,
          // 拐点的样式的设置
          itemStyle: {
            opacity: 0
          },
          // 线条的样式
          lineStyle: {
            color: "purple",
          },
          areaStyle: {
            color: {
              type: 'linear',
              x: 0,
              y: 0,
              x2: 0,
              y2: 1,
              colorStops: [{
                offset: 0, color: 'purple' // 0% 处的颜色
              }, {
                offset: 1, color: '#fff' // 100% 处的颜色
              }],
              global: false // 缺省为 false
            }
          },

        },

      ],
      grid: {
        left: 0,
        right: 0,
        top: 0,
        bottom: 0,
      },
    }

    lineCharts.setOption(options)


  },

}
</script>

<style scoped>
.charts {
  width: 100%;
  height: 100%;

}
</style>
